package com.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.*;
import lombok.Data;

@Data
@Entity
@Table(name = "route_destination")
@TableName("route_destination")
public class RouteDestination {
    @Id
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @Column(name = "route_id")
    private Long routeId;
    
    @Column(name = "destination_id")
    private Long destinationId;
    
    @ManyToOne
    @JoinColumn(name = "route_id", insertable = false, updatable = false)
    @TableField(exist = false)
    private Route route;
    
    @ManyToOne
    @JoinColumn(name = "destination_id", insertable = false, updatable = false)
    @TableField(exist = false)
    private Destination destination;
}